# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-game-libretro
pkgver=19.0.0
_realname=Matrix
pkgrel=0
pkgdesc="Libretro compatibility layer for the Kodi Game API"
options="!check" # no test suite
url="https://github.com/kodi-game/game.libretro"
arch="x86 x86_64 aarch64 armv7" # kodi
license="GPL-2.0-only"
makedepends="cmake kodi-dev"
depends="libretro-core-info"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/kodi-game/game.libretro/archive/$pkgver-$_realname.tar.gz"
builddir="$srcdir/game.libretro-$pkgver-$_realname"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi \
		-DUSE_LTO=1
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
a746b3b1e962e01af6b26a8f5c35c673f28e1248115a266528c1cd333ec132075948d0ca8d6ac0a5fcc07f80c4f881b0d819d59768b572f93f47daf43bbeff5b  kodi-game-libretro-19.0.0-Matrix.tar.gz
"
